import { createRouter, createWebHashHistory } from 'vue-router'
import IndexView from '../views/IndexView.vue'

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'index',
      component: IndexView
    },
    {
      path: '/music',
      name: 'music',
      component: () => import('../views/MusicView.vue')
    },
    {
      path: '/about',
      name: 'about',
      component: () => import('../views/AboutView.vue')
    },

    {
      path: '/article',
      name: 'article',
      component: () => import('../views/ArticleView.vue')
    },
    {
      path: '/list',
      name: 'list',
      component: () => import('../views/ListView.vue')

    },
    {
      path: '/grid',
      name: 'grid',
      component: () => import('../views/GridView.vue')
    },

    {
      path: '/login',
      name: 'login',
      component: () => import('../views/LoginView.vue')
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('../views/HomeView.vue'),
      children: [
        {
          path: '/home/categories',
          name: 'categories',
          component: () => import('../views/admin/CategoriesPage.vue')
        },
        {
          path: '/home/articles',
          name: 'articles',
          component: () => import('../views/admin/ArticleListPage.vue')
        },
        {
          path: '/home/screenshots',
          name: 'screenshots',
          component: () => import('../views/admin/ScreenshotsPage.vue')
        },
        {
          path: '/home/resources',
          name: 'resources',
          component: () => import('../views/admin/ResourcesPage.vue')
        },
        {
          path: '/home/projects',
          name: 'projects',
          component: () => import('../views/admin/ProjectsPage.vue')
        },
        {
          path: '/home/profile',
          name: 'profile',
          component: () => import('../views/admin/ProfilePage.vue')
        }
      ]
    }
  ]
})

export default router
